Skip to content

fix: improve system prompt and tool argument validation#1346

Open
ilonae wants to merge 1 commit intoFoundationAgents:mainfrom
ilonae:fix/tool-argument-validation
Open

fix: improve system prompt and tool argument validation#1346
ilonae wants to merge 1 commit intoFoundationAgents:mainfrom
ilonae:fix/tool-argument-validation

Conversation

@ilonae
Copy link
Copy Markdown

@ilonae ilonae commented Apr 4, 2026

Fixes #1345

Features

  • Improve system prompt to discourage unnecessary tool use for simple queries
  • Added validation for missing required tool arguments with informative error messages

Feature Docs

N/A - Bug fix for existing functionality

Influence
This fix addresses a critical usability issue where simple factual questions (e.g., "where is Boston?") would trigger unnecessary tool calls without required parameters, resulting in TypeErrors.

Impact:

  • Simple queries now receive direct answers without tool invocation
  • When tools are called, missing required arguments are caught early with clear error messages
  • Agent can better self-correct when tools are invoked incorrectly
  • Improved developer experience with more informative error logs

Result
Before fix:
TypeError: PythonExecute.execute() missing 1 required positional argument: 'code'

After fix:
Simple query: "where is Boston?"

  • Agent answers directly without attempting to use python_execute
  • If tool is called without parameters, error message explains the issue:
    "Tool 'python_execute' was called with missing required arguments.
    missing 1 required positional argument: 'code'.
    Please ensure all required parameters are provided when calling this tool."

- Improve system prompt to discourage unnecessary tool use
- Added validation for missing required tool arguments

Fixes #[1345]
@ilonae ilonae force-pushed the fix/tool-argument-validation branch from 55e2a36 to ca0db6b Compare April 4, 2026 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent calls python_execute without required arguments for simple queries

1 participant